<template>
	<div><div ref="dplayer"></div></div>
</template>
<script lang="js">
import { Component, Vue } from 'vue-property-decorator';
import DPlayer from 'dplayer';
@Component
export default class Live extends Vue {
	mounted() {
		console.log(1);
		let videoRef = this.$refs.dplayer;
		console.log(videoRef);
		const dp = new DPlayer({
			container: videoRef,
			live:true,
			// danmaku: true,
			// apiBackend: {
   //      read: function (endpoint, callback) {
   //          console.log('Pretend to connect WebSocket');
   //          callback();
   //      },
   //      send: function (endpoint, danmakuData, callback) {
   //          console.log('Pretend to send danmaku via WebSocket', danmakuData);
   //          callback();
   //      },
   //  },
    video: {
        url: 'rtmp://live-push.bilivideo.com/live-bvc/',
        type: 'hls',
    },
		});
	}
}
</script>
